﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jacaranda.Model
{
    public class NoClause : InClause
    {
        internal override string GenerateSql(Type propertyEntityType)
        {
            string keyToSelect = IsForwardDirection ? "Key1" : "Key2";

            return string.Format("{0} NOT IN (SELECT {1} FROM {2})",
                   IsTopMost ? TopMostKeyFieldName : null,
                   keyToSelect,
                   Association.TableName);
        }
    }
}
